package overall.manager
{
	import overall.Iscene;
	
	import randomNum.RandomNumScene;
	
	import starling.display.Sprite;

	public class SceneManager
	{
		public function SceneManager()
		{
		}
		static private var _instance:SceneManager;
		static public function get instance():SceneManager{
			_instance=_instance||new SceneManager;
			return _instance;
		}
		
		public static const RANDOM_SCENE:String="random_scene";	
		
		
		private var _baseScene:Iscene;
		public function show(str:String):void
		{
			_removeScene();
			switch(str){
				case RANDOM_SCENE:
					_baseScene=new RandomNumScene;
					break;
			}
			LayerManager.instance.gameLayer.addChild(_baseScene as Sprite);
		}
		
		private function _removeScene():void
		{
            if(_baseScene){
				_baseScene.destroy();
			}
			_baseScene=null;
		}
	}
	
}